<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<div id="box"></div>

<script>

        var name1="周星驰";
        var name2="吴孟达";
        var mod =new Object({
        _zuoping:["大话西游","九品芝麻官","审死官"],

        hezuo:function(){
            console.log(name1+"和"+name2+"合作了"+"《"+this._zuoping[1]+"》"+"《"+this._zuoping[2]+"》"+"《"+this._zuoping[0]+"》"+"这几部电影")
            for(var i=0;i<this._zuoping.length;i++){
                console.log(name1+"和"+name2+"合作了"+"《"+this._zuoping[i]+"》")
            }
        }
    });
        mod.hezuo()
//闭包
                var mod2 =(function(){
                    var name1="周星驰";
                    var name2="吴孟达";
                    var zuoping=["大话西游","九品芝麻官","审死官"]

                    function hezuo1(){
                        var str =name1+"和"+name2+"合作了:";
                        for(var i=0;i<zuoping.length;i++){
                            str+="《"+zuoping[i]+"》"
                        }
                        return str;
                    }
                    return hezuo1;
                })();
                console.log(mod2())





</script>
</body>
</html>